<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="/dev/asset/jquery/jquery-3.5.1.min.js"></script>
    <script src="/dev/asset/js/Job.js"></script>
    <link rel="stylesheet" type="text/css" href="/dev/asset/css/Job.css">
    <script type="text/javascript"
            src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=fNTKsHabAB1DEc7K2SLh67LdjokoCr8B">
    </script>
    <title>Job</title>
</head>

<body>
<div id="box">
    <!-- 导航栏 -->
    <div class="headerBox">
        <%@ include file="../../asset/common/header.jsp" %>
    </div>

    <!-- 基本信息栏 -->
    <div class="company-banner ">
        <div class="home-inner">
            <div class="home_left">
                <div class="name_money">
                    <span>${job.name}</span>
                    <span>${job.minMoney}k-${job.maxMoney}k</span>
                </div>
                <div class="request">
                    <ul>
                        <li>${job.city}</li>
                        <li><c:choose>
                            <c:when test="${job.needWorktime==0}">
                                不限
                            </c:when>
                            <c:when test="${job.needWorktime==1}">
                                应届
                            </c:when>
                            <c:when test="${job.needWorktime==2}">
                                一年以内
                            </c:when>
                            <c:when test="${job.needWorktime==3}">
                                一到三年
                            </c:when>
                            <c:when test="${job.needWorktime==4}">
                                三年到五年
                            </c:when>
                            <c:when test="${job.needWorktime==5}">
                                五年以上
                            </c:when>
                        </c:choose></li>
                        <li><c:choose>
                            <c:when test="${job.needSchoollevel==0}">
                                大专以下
                            </c:when>
                            <c:when test="${job.needSchoollevel==1}">
                                大专
                            </c:when>
                            <c:when test="${job.needSchoollevel==2}">
                                本科
                            </c:when>
                            <c:when test="${job.needSchoollevel==3}">
                                硕士
                            </c:when>
                            <c:when test="${job.needSchoollevel==4}">
                                博士及以上
                            </c:when>
                        </c:choose></li>
                    </ul>
                </div>

                <div class="button3">
                    <div class="loved" onclick="addLove(${job.id})">收藏</div>
                    <input type="hidden" class="token" value="${FormToken}">
                    <div class="apple" onclick="appleResume(${job.id})">
                        <c:if test="${applyedd}">已投递</c:if>
                        <c:if test="${!applyedd}">投递简历</c:if>
                        </div>
                    <div class="noshow"  onclick="notLike(${job.id})">屏蔽</div>
                </div>
            </div>

            <div class="home_right">
                <div class="welfare">
                    <c:forEach items="${welfare}" var="w" varStatus="vs">
                        <li>${w}</li>
                    </c:forEach>
                </div>

                <div class="applebutton" onclick="goPersonal()">
                    完善简历
                </div>
            </div>
        </div>
    </div>

    <!-- 中部详情栏 -->
    <div class="job_middle">

        <div class="home_inner">

            <div class="job_detail">
                <div class="job_detail_1">
                    <div class="job_detail_1_1">
                        <h3>职位描述</h3>
                    </div>
                    <div class="job_detail_1_2">
                        <c:forEach items="${sim}" var="s">
                            <span>${s}</span>
                        </c:forEach>

                    </div>
                    <div class="job_detail_1_3">
                        <p class="job_detail_1_3_head">岗位职责</p>
                        ${job.jobDo}
                    </div>

                    <div class="job_detail_1_3">
                        <p class="job_detail_1_3_head">职位要求</p>
                        ${job.jobRequest}
                    </div>

                    <div class="job_detail_1_4">
                        ${hr.name}
                    </div>

                </div>

                <div class="job_detail_1">
                    <div class="job_detail_1_1">
                        <h3>公司介绍</h3>
                        <div class="job_companymsg">
                            ${company.companyMsg}
                        </div>
                    </div>

                    <div class="job_detail_1_1">
                        <h3>工商信息</h3>
                        <div class="businessMsg">
                            <ul class="businessMsg_ul">
                                <li>
                                    <span>公司名称:</span>
                                    <p style="padding-top: 10px"> ${businessmsg.companyName}</p>
                                </li>
                                <li>
                                    <span>法定法人:</span>
                                    <p style="padding-top: 10px"> ${businessmsg.boss}</p>
                                </li>
                                <li>
                                    <span>成立时间:</span>
                                    <p style="padding-top: 10px">${businessmsg.createTime}</p>
                                </li>
                            </ul>
                            <div class="businessMsg_msg_title">
                                经营范围：
                            </div>
                            <div class="businessMsg_msg">
                                ${businessmsg.workMsg}

                            </div>
                        </div>
                        <h3 class="businessMsg_top">公司地址</h3>
                        <p style="color: #adadad">${job.address}</p>
                        <div id="address">
                        </div>
                    </div>

                </div>

            </div>

            <div class="job_right">
                <div class="job_company">
                    <div class="job_company_1">
                        公司基本信息
                    </div>
                    <div class="job_company_2">
                        <img src="${company.icon}" alt="" width="40px" height="40px"><span>${company.name}</span>
                    </div>
                    <div class="job_company_3">
                        <p><c:choose>
                            <c:when test="${company.collectmoneyState==0}">
                                未融资
                            </c:when>
                            <c:when test="${company.collectmoneyState==1}">
                                天使轮
                            </c:when>
                            <c:when test="${company.collectmoneyState==2}">
                                A轮
                            </c:when>
                            <c:when test="${company.collectmoneyState==3}">
                                B轮
                            </c:when>
                            <c:when test="${company.collectmoneyState==4}">
                                C轮
                            </c:when>
                            <c:when test="${company.collectmoneyState==5}">
                                D轮
                            </c:when>
                            <c:when test="${company.collectmoneyState==6}">
                                已上市
                            </c:when>
                            <c:when test="${company.collectmoneyState==7}">
                                不需要融资
                            </c:when>
                        </c:choose></p>
                        <p><c:choose>
                            <c:when test="${company.peopleCounts==0}">
                                0-20人
                            </c:when>
                            <c:when test="${company.peopleCounts==1}">
                                20-99人
                            </c:when>
                            <c:when test="${company.peopleCounts==2}">
                                100-499人
                            </c:when>
                            <c:when test="${company.peopleCounts==3}">
                                500-999人
                            </c:when>
                            <c:when test="${company.peopleCounts==4}">
                                1000-9999人
                            </c:when>
                            <c:when test="${company.peopleCounts==5}">
                                10000人以上
                            </c:when>
                        </c:choose></p>
                        <p>${company.kind}</p>
                    </div>

                    <div class="job_company_botton" onclick="goCompany(${company.id})">
                        查看公司主页
                    </div>
                </div>

                <div class="job_right_pic">
                    <img src="http://rr2xgprkx.hn-bkt.clouddn.com/2023/03/06/job.jpeg" alt="">
                    <img src="http://rr2xgprkx.hn-bkt.clouddn.com/2023/03/06/dog.png" alt="">
                </div>
            </div>

        </div>

    </div>

    <%@ include file="../../asset/common/foot.jsp" %>


</div>

<script>
    var map = new BMapGL.Map("address");
    map.enableScrollWheelZoom();    //启用滚轮放大缩小，默认禁用
    // var scaleCtrl = new BMapGL.ScaleControl();  // 添加比例尺控件
    // map.addControl(scaleCtrl);
    // var zoomCtrl = new BMapGL.ZoomControl();  // 添加缩放控件
    // map.addControl(zoomCtrl);
    var cityCtrl = new BMapGL.CityListControl();  // 添加城市列表控件
    map.addControl(cityCtrl);

    // 创建地址解析器实例
    var myGeo = new BMapGL.Geocoder();
    // 将地址解析结果显示在地图上,并调整地图视野
    myGeo.getPoint("${job.address}", function (point) {
        if (point) {
            map.centerAndZoom(point, 16);
            map.addOverlay(new BMapGL.Marker(point));
        } else {
            alert("您选择地址没有解析到结果!");
        }
    },);

    if($(".loginA").text()!="请登录")
    {
        console.log("kkkkkkk")
        let nav_right_event = document.querySelector(".nav_right li:nth-child(3)");
        let nav_right_div = document.querySelector(".nav_right_msg");

        nav_right_event.onmouseover = function () {
            nav_right_div.setAttribute('style', "display:block");
        }
        nav_right_event.onmouseout = function () {
            nav_right_div.setAttribute('style', "display:none");
        }

        nav_right_div.onmouseover = function () {
            nav_right_div.setAttribute('style', "display:block");
        }
        nav_right_div.onmouseout = function () {
            nav_right_div.setAttribute('style', "display:none");
        }
    }

    let ws;
    //模拟产生clientID
    //可以使用唯一的用户的id
    let clientID = Math.ceil(Math.random()*100);
    //创建 WebSocket 对象,注意请求路径！！！！
    ws = new WebSocket("ws://localhost:8088/dev/tt/"+clientID);

    ws.onopen = function(){
        console.log("<p>与服务端建立连接建立成功！您的客户端ID="+clientID+"</p>");

        //模拟发送数据到服务器
        // ws.send("你好服务端！我是客户端 "+clientID);
    }

    //接收到服务端消息时触发
    ws.onmessage = function (evt) {
        let received_msg = evt.data;
        console.log("<p>接收到服务端消息:"+received_msg+"</p>");
    };

    //服务端关闭连接时触发
    ws.onclose = function() {
        console.error("连接已经关闭.....")
    };

</script>
</body>

</html>